/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package azhar.com;

import azhar.view.Main;
import java.util.ArrayList;

/**
 *
 * @author Al-Insan
 */
public class FilterNumber {

    private Main main;

    public FilterNumber(Main m) {
        main = m;
    }

    public ArrayList<String> getNumbers(String number) {
        ArrayList<String> d = new ArrayList<String>();
        if (isNumber(number)) {
            d.add(number);
        }else if(isGroup(number)){

        }
        return d;
    }

    public String getGroupName(String number) {
        return number.substring(3);
    }

    public boolean isGroup(String number){
        if (number.split(":", 2)[0].equals("G")) {
            return true;
        }
        return false;
    }

    public boolean isNumber(String number) {
        try {
            Integer.parseInt(number.substring(1));
            return true;
        } catch (Exception e) {
        }
        return false;
    }

}
